<style>
    #titlePed{
        color: green;
        display: block;
        width: 200px;
        padding: 10px;
    }
    /*  body{
          margin: 50px;
  
      }*/
    .items{
        width: 200px;
        text-align: center;
        border-left: 1px solid black;
        margin: 10px;
    }

    .item{
        width: 200px;
        text-align: center;
        padding: 5px;
    }

    .pedidos{
        border: 1px solid black;
        margin-bottom: 20px;
        box-shadow: black 0.4em 0.3em 0.3em;

    }

    .borda1{
        border-bottom: 1px solid black;		
        padding: 10px;
        background-image: url('/theme/default/imgs/fundoPed.jpg');
        color: white;
    }


</style>
<div id="all">
    <h1 id="titlePed">Pedidos</h1>
</div>
<?php  $mesa=0;?>
<?php foreach ($this->itens as $item): ?>
    <?php if($mesa != $item['mesa']): ?>
        <?php if($mesa != 0): ?>
            </table>
        <?php endif; ?>
            
        <?php $mesa = $item['mesa']?>
            <table class="pedidos">
                <thead>
                    <tr>
                        <th class="borda1" align="center" colspan="5">Mesa <?= $mesa ?></th>
                    </tr>
                    <tr class="borda1">
                        <th >Produto</th>
                        <th>Quantidade</th>
                        <th>Valor Unidade</th>
                        <th>Valor Total</th>
                        <th>Confirmar</th>
                    </tr>
                </thead>
                <tr>
                    <td class="item"><?= $item['produto'] ?></td>
                    <td class="items"><?= $item['qnttotal'] ?></td>
                    <td class="items"><?= $item['preco'] ?></td>
                    <td class="items"><?= $item['vlrtotal'] ?></td>
                    <td class="items"><a href="/pedido/lista/confirma?codigo=<?= $item['iditem'] ?>">X</a></td>
                </tr>
    <?php else: ?>
                <tr>
                    <td class="item"><?= $item['produto'] ?></td>
                    <td class="items"><?= $item['qnttotal'] ?></td>
                    <td class="items"><?= $item['preco'] ?></td>
                    <td class="items"><?= $item['vlrtotal'] ?></td>
                    <td class="items"><a href="/pedido/lista/confirma?codigo=<?= $item['iditem'] ?>">X</a></td>
                </tr>
    <?php endif; ?>


<?php endforeach;?>
                </table>
            <!--
<table class="pedidos">
    <tr>
        <td class="borda1" align="center" colspan="4">Mesa 1</td>
    </tr>
    <tr>
        <td class="item">Item 1</td>
        <td class="items">Quantidade X</td>
        <td class="items">Observações</td>
        <td class="items">Preco</td>
    </tr>
</table>
<table class="pedidos">
    <tr>
        <td class="borda1" align="center" colspan="4">Mesa 2</td>
    </tr>
    <tr>
        <td class="item">Item 1</td>
        <td class="items">Quantidade X</td>
        <td class="items">Observações</td>
        <td class="items">Preco</td>
    </tr>
</table>
<table class="pedidos">
    <tr>
        <td class="borda1" align="center" colspan="4">Mesa 3</td>
    </tr>
    <tr>
        <td class="item">Item 1</td>
        <td class="items">Quantidade X</td>
        <td class="items">Observações</td>
        <td class="items">Preco</td>
    </tr>
</table>-->



